/*
 * MIT License
 *
 * Copyright (c) 2025 Mark·虎
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

package com.hsxxherp.key.common.entity;

import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;
import java.sql.Date;

/**
 * 模型： 基础实体
 *
 * @author Mark·虎克（2486970363@qq.com）
 */
public class BaseEntity implements Serializable {

    @Schema(description = "软删除标识，0 表示记录未删除，1 表示记录已被软删除", example = "false")
    protected Boolean isDeleted;
    @Schema(description = "账户的创建时间，记录账户信息插入到表中的时间", example = "2024-01-01 12:00:00")
    protected Date createdTime;

    @Schema(description = "账户信息的修改时间，当记录发生更新时，该字段会自动更新为当前时间", example = "2024-01-02 13:00:00")
    protected Date updatedTime;

    @Schema(description = "版本字段，用于乐观锁控制，每次更新记录时版本号自动加 1，防止并发更新冲突", example = "1")
    protected Integer version;

    @Schema(description = "创建该账户记录的人员，最大长度为 64 个字符，可为空", example = "管理员")
    protected String creator;

    @Schema(description = "最后一次修改该账户记录的人员，最大长度为 64 个字符，可为空", example = "管理员")
    protected String updator;

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean deleted) {
        isDeleted = deleted;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getUpdator() {
        return updator;
    }

    public void setUpdator(String updator) {
        this.updator = updator;
    }
}
